﻿using AutoMapper;
using System;
using System.Collections.Generic;
using System.Text;
using TL_Cloud.Models.BookShop;
using TL_Cloud.ViewModels.BookShop.BKInfo;

namespace TL_Cloud.ViewModels.BookShop.BKCollect
{
    public class BKCollectResource: BKInfoBasicResource
    {
        public string CollectId { get; set; }
        public string BookId { get; set; }

        public string CollectUserId { get; set; }
        public string CollectUserName { get; set; }

        public DateTime? CreateDate { get; set; }

    }

    public class BKCollecttMappingProfile : Profile
    {
        public BKCollecttMappingProfile()
        {
            CreateMap<Bk_Collect, BKCollectResource>()
                .ForMember(dest => dest.BookName, opt => opt.MapFrom(src => src.bookInfo.BookName))
                .ForMember(dest => dest.BKTypeId, opt => opt.MapFrom(src => src.bookInfo.BKTypeId))
                .ForMember(dest => dest.Author, opt => opt.MapFrom(src => src.bookInfo.Author))
                .ForMember(dest => dest.Pulisher, opt => opt.MapFrom(src => src.bookInfo.Pulisher))
                .ForMember(dest => dest.Isbn, opt => opt.MapFrom(src => src.bookInfo.Isbn))
                .ForMember(dest => dest.ConverUrl, opt => opt.MapFrom(src => src.bookInfo.ConverUrl))
                .ForMember(dest => dest.Introduce, opt => opt.MapFrom(src => src.bookInfo.Introduce))
                .ForMember(dest => dest.Remark, opt => opt.MapFrom(src => src.bookInfo.Remark));
        }
    }
}
